import { IFeidaoAiNodejsComponent } from '@feidao/web/interfaces';
import P01 from './P01';
import nodejs from '@feidao/web/atom/nodejs/msg-b/nodejs';
import server_render from '../atom/server-render';


export default async function (fd: IFeidaoAiNodejsComponent, ...args: any[]) {
	const param = {
		criteria: {},
		page_size: 0,
		page_no: 1
	};
	const res = await nodejs('flippedclass', 'teacher-type-find', param);
	console.warn('.................... nba001 .................', res);

	if (res.length === 0) {
		server_render(fd.data.node, 'P01', P01, []);
	} else {
		server_render(fd.data.node, 'P01', P01, res);
	}
	fd.data.default_exam = res[0].exam_id;
}